<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>HTML5 MediaElement</title>
    <script src="../build/jquery.js"></script>
    <script src="testforfiles.js"></script>

    <script src="../build/mediaelement-and-player.min.js"></script>
    <script src="../build/lang/me-i18n-locale-cs.js"></script>
    <script src="../build/lang/me-i18n-locale-de.js"></script>
    <script src="../build/lang/me-i18n-locale-en.js"></script>
    <script src="../build/lang/me-i18n-locale-es.js"></script>
    <script src="../build/lang/me-i18n-locale-fr.js"></script>
    <script src="../build/lang/me-i18n-locale-hu.js"></script>
    <script src="../build/lang/me-i18n-locale-it.js"></script>
    <script src="../build/lang/me-i18n-locale-ja.js"></script>
    <script src="../build/lang/me-i18n-locale-ko.js"></script>
    <script src="../build/lang/me-i18n-locale-nl.js"></script>
    <script src="../build/lang/me-i18n-locale-pl.js"></script>
    <script src="../build/lang/me-i18n-locale-pt.js"></script>
    <script src="../build/lang/me-i18n-locale-pt-br.js"></script>
    <script src="../build/lang/me-i18n-locale-ro.js"></script>
    <script src="../build/lang/me-i18n-locale-ru.js"></script>
    <script src="../build/lang/me-i18n-locale-sk.js"></script>
    <script src="../build/lang/me-i18n-locale-zh-cn.js"></script>
    <script src="../build/lang/me-i18n-locale-zh.js"></script>
    <link rel="stylesheet" href="../build/mediaelementplayer.min.css" />



</head>
<body>

<h1>MediaElement.js - i18n</h1>

<p>This is only the Flash/Silverlight Shim for older browsers or browsers without the codec you need. It is not a full player.</p>

<h2>MP4 video (as src)</h2>
<video width="360" height="203" id="player1" src="../media/echo-hereweare.mp4" type="video/mp4" controls="controls"></video>

<input type="button" id="pp" value="toggle" />
<span id="time"></span>

<div>
    <form action="#" method="get">
        <label>Language <select name="lang">
		<option value="cs">Čeština / Czech (cs)</option>
            	<option value="de">Deutsch / German (de)</option>
            	<option value="en" selected>English (en)</option>
            	<option value="es">Español / Spanish; Castilian (es)</option>
            	<option value="fr">Français / French (fr)</option>
            	<option value="hu">magyar / Hungarian (hu)</option>
            	<option value="it">Italiano / Italian (it)</option>
            	<option value="ja">日本語 / Japanese (ja)</option>
            	<option value="ko">한국어 / Korean (ko)</option>
            	<option value="nl">Nederlands / Dutch (nl)</option>
            	<option value="pl">Polski / Polish (pl)</option>
            	<option value="pt">Português / Portuguese (pt)</option>
            	<option value="pt-BR">Português / Brazilian Portuguese (pt-BR)</option>
            	<option value="ro">Română / Romanian (ro)</option>
            	<option value="ru">Русский / Russian (ru)</option>
           	<option value="sk">Slovensko / Slovak (sk)</option>
           	<option value="zh-cn">简体中文 / Simplified Chinese (zh-CN)</option>
           	<option value="zh">繁体中文 / Traditional Chinese (zh-TW)</option>
        </select>
        </label>
    </form>
</div>

<script>

    function getQueryStringValue (key) {
        return decodeURIComponent(window.location.search.replace(new RegExp("^(?:.*[&\\?]" + encodeURIComponent(key).replace(/[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"), "$1"));
    }

    var lang = getQueryStringValue('lang') || 'en';
    mejs.i18n.locale.language = lang;

    $('select').on('change', function() {
        var url = window.location.href.replace(/^(.*?)\?.*$/, "$1");
        window.location.href = url + "?lang=" + $(this).val();
    }).val(lang);

    $('audio,video').mediaelementplayer({
        features: ['playpause','progress','volume','speed','fullscreen', 'skipback'],
        success: function(player, node) {

            mejs.i18n.locale.language = mejs.i18n.getLanguage();

            $(player).closest(".mejs-container").attr("lang", mejs.i18n.getLanguage());

            // Optional
            $("html").attr("lang", mejs.i18n.getLanguage());

            $('#' + node.id + '-mode').html('mode: ' + player.pluginType);

            player.play();

            player.addEventListener('timeupdate', function() {
                document.getElementById('time').innerHTML = player.currentTime;
            }, false);

            document.getElementById('pp')['onclick'] = function() {
                if (player.paused)
                    player.play();
                else
                    player.pause();
            };
        }
    });
</script>

</body>
</html>
